package com.hyh.music.mapper;

import com.github.pagehelper.Page;
import com.hyh.music.domain.domainDTO.SongListDTO;
import com.hyh.music.domain.domainDTO.MessagePageDTO;
import com.hyh.music.domain.domains.SongList;
import org.apache.ibatis.annotations.*;

/**
 * @author hyh
 * @version 1.0
 */
@Mapper
public interface SongListMapper {

    Page<SongList> Page(MessagePageDTO messagePageDTO);

    /**
     * 添加歌单
     * @param songListDTO
     */
    @Insert("insert into song_list (title, image, introduction, style)" +
            " VALUES (#{title},#{image},#{introduction},#{style}) ")
    void add(SongListDTO songListDTO);
    @Select("select * from song_list where id = #{id}")
    SongList selectById(@Param("id") Integer id);

    /**
     * 更新
     * @param songList
     */
    void update(SongList songList);

    /**
     * 删除
     * @param id
     */
    @Delete("delete from song_list where id = #{id}")
    void delete(@Param("id") Integer id);
}
